/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.Dimension;

/**
 *
 * @author Thomas
 */
public class HilfeWindow extends javax.swing.JDialog {

    /**
     * Creates new form HilfeWindow
     */
    public HilfeWindow(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setTitle("HILFE");
        this.setMinimumSize(new Dimension(300, 350));
        this.setLocationRelativeTo(null);
        this.setHilfeText();
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        epText = new javax.swing.JEditorPane();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        epText.setEditable(false);
        epText.setBackground(new java.awt.Color(217, 186, 78));
        epText.setContentType("text/html"); // NOI18N
        jScrollPane1.setViewportView(epText);

        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);

        jButton1.setBackground(new java.awt.Color(217, 186, 78));
        jButton1.setFont(new java.awt.Font("NSimSun", 0, 24)); // NOI18N
        jButton1.setText("OK");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                onOK(evt);
            }
        });
        getContentPane().add(jButton1, java.awt.BorderLayout.PAGE_END);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void onOK(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onOK
        this.dispose();
    }//GEN-LAST:event_onOK

    public void setHilfeText()
    {
        String firmenDaten=(""
                    + "<html>"
                    + "<head>"
                    + "</head>"
                    + "<body bgcolor=\"#660000\">"
                    + "<p color=\"#FF9933\" style=\"font-variant:normal; font-size:130%;\">HILFE!</p>"
                    + "<span color=\"#FFFFFF\">&nbsp;&nbsp;"
                    + "Hilfetext Blablablablabla jaja hbkalalalala "
                    +"<br>"
                    + "</span>"
                    + "<br>"
                    + "<hr>"
                    + "<span color=\"#FFFFFF\">&nbsp;<i>War das hilfreich?</i>"
                    + "<hr>"
                    + "</body>"
                    + "</html>");
        
        epText.setText(firmenDaten);
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(HilfeWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(HilfeWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(HilfeWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(HilfeWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                HilfeWindow dialog = new HilfeWindow(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane epText;
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
